package business.entity;

/**
 * 名片类
 * 
 * @author Y_x,陈贤森, WinDaLex
 * 
 */

public class Card {

	/*
	 * 名片ID
	 */
	private int id;

	/*
	 * 姓名
	 */
	private String name;

	/*
	 * 电话号码
	 */
	private String telephone;

	/*
	 * 邮箱
	 */
	private String email;

	/*
	 * qq号码
	 */
	private String qq;

	/*
	 * 微博
	 */
	private String weibo;

	public Card() {
		super();
		telephone = "";
		email = "";
		qq = "";
		weibo = "";
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getTelephone() {
		return telephone;
	}

	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getQq() {
		return qq;
	}

	public void setQq(String qq) {
		this.qq = qq;
	}

	public String getWeibo() {
		return weibo;
	}

	public void setWeibo(String weibo) {
		this.weibo = weibo;
	}

	@Override
	public String toString() {
		return "Card [id=" + id + ", name=" + name + ", telephone=" + telephone
				+ ", email=" + email + ", qq=" + qq + ", weibo=" + weibo + "]";
	}

	/*
	 * public static final int VERIFY_TRUE = 0; public static final int
	 * VERIFY_FALSE = 1; public static int MAX_NAME_LEN = 50; public static int
	 * MAX_EMAIL_LEN = 50; public static int MAX_QQ_LEN = 20; public static int
	 * MAX_TEL_LEN = 20; public static int MAX_WEIBO_LEN = 24;
	 */

	/*
	 * 验证weibo格式是否符合规则。
	 * 
	 * public int verifyCardWeibo() { // TODO if (weibo == null ||
	 * "".equals(weibo)) { return VERIFY_TRUE; } if (weibo.length() < 4 ||
	 * weibo.length() > MAX_WEIBO_LEN) { return VERIFY_FALSE; } return
	 * VERIFY_TRUE; }
	 * 
	 * 
	 * 验证qq格式是否符合规则。
	 * 
	 * public int verifyCardQQ() { // QQ规则 String rule = "\\d{4,20}"; if (qq ==
	 * null || "".equals(qq)) { return VERIFY_TRUE; } else if
	 * (!qq.matches(rule)) { return VERIFY_FALSE; } return VERIFY_TRUE; }
	 * 
	 * 
	 * 验证telephone格式是否符合规则。
	 * 
	 * public int verifyCardTelephone() { // 电话的规则 String rule = "\\d{8,20}"; if
	 * (telephone == null || "".equals(telephone)) { return VERIFY_TRUE; } else
	 * if (!telephone.matches(rule)) { return VERIFY_FALSE; } return
	 * VERIFY_TRUE; }
	 * 
	 * 
	 * 验证email格式是否符合规则。 email 的长度> 0 且小于 50 必需是mail的格式
	 * 
	 * public int verifyCardEmail() { String rulePattern =
	 * "^([a-zA-Z0-9_\\-\\.]+)@" +
	 * "((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(" +
	 * "([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$"; if (email ==
	 * null || "".equals(email)) { return VERIFY_TRUE; } else if (email.length()
	 * > MAX_EMAIL_LEN) { return VERIFY_FALSE; } else if
	 * (!email.matches(rulePattern)) { return VERIFY_FALSE; }
	 * 
	 * return VERIFY_TRUE; }
	 * 
	 * 
	 * 验证名字格式是否符合规则。 名字 不能为null or 不能为 "" 名字 的长度> 0 且小等于 20
	 * 
	 * public int verifyCardName() { // 名字不能为空 if (name == null ||
	 * "".equals(name)) { return VERIFY_FALSE; } else if (name.length() >
	 * MAX_NAME_LEN) { return VERIFY_FALSE; } return VERIFY_TRUE; }
	 */

}
